using MediatR;
using B.S.RbacData.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace SupplierCustomerManagement.Write.API.Applications.Commands.servicepersonals
{
    /// <summary>
    /// 更新服务人员命令
    /// </summary>
    public class UpdateServicePersonalCommand : IRequest<ApiResult<bool>>
    {
        /// <summary>
        /// 服务人员ID
        /// </summary>
        [Required(ErrorMessage = "服务人员ID不能为空")]
        public int Id { get; set; }

        /// <summary>
        /// 关联实体ID（客户ID或供应商ID）
        /// </summary>
        [Required(ErrorMessage = "关联实体ID不能为空")]
        public int RelatedEntityId { get; set; }

        /// <summary>
        /// 关联实体类型（Customer/Supplier）
        /// </summary>
        [Required(ErrorMessage = "关联实体类型不能为空")]
        [StringLength(20, ErrorMessage = "关联实体类型长度不能超过20个字符")]
        public string RelatedEntityType { get; set; } = string.Empty;

        /// <summary>
        /// 客户所属市场
        /// </summary>
        [StringLength(100, ErrorMessage = "客户所属市场长度不能超过100个字符")]
        public string? CustomerMarket { get; set; }

        /// <summary>
        /// 服务类型（客户经理等）
        /// </summary>
        [Required(ErrorMessage = "服务类型不能为空")]
        [StringLength(50, ErrorMessage = "服务类型长度不能超过50个字符")]
        public string ServiceType { get; set; } = string.Empty;

        /// <summary>
        /// 服务人员姓名
        /// </summary>
        [Required(ErrorMessage = "服务人员姓名不能为空")]
        [StringLength(50, ErrorMessage = "服务人员姓名长度不能超过50个字符")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 是否为默认服务人员
        /// </summary>
        public bool IsDefault { get; set; } = false;
    }
}